In commutative algebra, if R is a commutative ring and M an R-module, a nonzero element r in R is called M-regular if r is not a zerodivisor on M, and M/rM is nonzero. An R-regular sequence on M is a d-tuple
such that for each i ≤ d, ri is Mi-1-regular, where Mi-1 is the quotient R-module
Such a sequence is also called an M-sequence.
An R-regular sequence is usually called simply a regular sequence.
It may be that r1, ..., rd is an M-sequence, and yet some permutation of the sequence is not. It is, however, a theorem that if R is a local ring or if R is a graded ring and the ri are all homogeneous, then a sequence is an R-sequence only if every permutation of it is an R-sequence.
The depth of R is defined as the maximum length of a regular R-sequence on R. More generally, the depth of an R-module M is the maximum length of an M-regular sequence on M. The concept is inherently module-theoretic and so there is no harm in approaching it from this point of view.
The depth of a module is always at least 0 and no greater than the Krull dimension of the module.
An important case is when the depth of a ring equals its Krull dimension: the ring is then said to be a Cohen-Macaulay ring. The three examples shown are all Cohen-Macaulay rings. Similarly in the case of modules, the module M is said to be Cohen-Macaulay if its depth equals its dimension.